package com.bawei.web;

import com.baidu.entity.Borr;
import com.baidu.utils.ResultResponse;
import com.bawei.serves.LoansServes;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author lvchong
 * @Description: 修改
 * @Date: Created in 2021/12/14 8:45
 * @Modified By:
 */
@RestController
@Slf4j
@RequestMapping("loan")
public class LoanWeb {
    @Resource
    private LoansServes loansServes;

    //用户借款，需要传用户userid，产品pid，期数的nid,和借款金额prices
    @RequestMapping("preview")
    public ResultResponse preview(@RequestBody Borr borr){
        return loansServes.preview(borr);
    }
    //执行借款
    @RequestMapping("borrow")
    public ResultResponse borrow(@RequestBody Borr borr){
        return loansServes.borrow(borr);
    }
    //查询各种列表通过map形式返回
    @RequestMapping("particulars")
    public ResultResponse particulars(){
        return loansServes.particulars();
    }
    //查询审核通过的列表
    @RequestMapping("product")
    public ResultResponse product(){
        return loansServes.product();
    }
    //查看各种收益
    @RequestMapping("proa")
    public ResultResponse proa(){
        return loansServes.proa();
    }
    //查看自己未还完的借款记录
    @RequestMapping("over")
    public ResultResponse over(@RequestBody Borr borr){
        return loansServes.over(borr);
    }
    //查看某一条的具体还款计划
    @RequestMapping("onesr")
    public ResultResponse onesr(@RequestBody Borr borr){
        return loansServes.onesr(borr);
    }

}
